<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: glls
  Date: 2022/3/29
  Time: 15:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>el表达式的语法</title>
</head>
<body>
<%
    //存储在request作用域
   // request.setAttribute("name","tom");
    request.setAttribute("age",18);
%>

${requestScope.name}

<hr>

<%
    request.setAttribute("num",1234);
    String ss = "123";
    request.setAttribute("ss",ss);
%>

<h1>算术运算</h1>
${num + 1}<br/>
${num - 1}<br/>
${num * 2}<br/>
${num div 2}<br/>
${num mod 2}<br/>
<hr/>
<h1>关系运算</h1>
${num == 1234}<br/>
${num != 1234}<br/>
${num > 1200}<br/>
${num < 1200}<br/>
${num >= 1234}<br/>
${num <= 1234}<br/>
<hr/>
<h1>逻辑运算</h1>
${num %2==0 || num /2 ==1}<br/>
${num % 2==0 && num % 4==0}<br/>
${!(num > 1234)}<br/>
<hr/>
<h1>empty运算符</h1>
${ss == null}<br/>
${empty ss}<br/>


<hr>
${empty name? "请登录" : "欢迎你"}  ${name}


<%
    pageContext.setAttribute("s1","");
    ArrayList<Object> list1 = new ArrayList<>();

%>
<%--empty 判断 空字符串   null  空的集合 都是 true--%>
${empty s1}
${empty list1}

<hr>
${param.productid}
${header.Cookie}

<hr>

${pageContext.request.contextPath}

<a href="/web_study/day5/13.jsp">13.jsp</a>

<a href="${pageContext.request.contextPath}/day5/13.jsp">13.jsp</a>


</body>
</html>
